<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="base" uri="http://qdbp.gitee.io/tags/base/"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<header class="lyt-header lyt-o-fixed ${param.headerClass}">

	<div class="lyt-logo">
		<a href="#" class="logo-icon"></a>
		<div class="logo-panel">
			<div class="flt-lft">
				<a href="#" class="logo-text">${pv.project.title}</a>
			</div>
			<div class="login-info hide-in-simple">
				<base:principal var="user">
				<a href="#" class="user-info open-mine-details" data-user-info="{tenantCode:'${user.tenantCode}',id:'${user.id}',displayName:'${user.displayName}'}">${user.displayName}</a>
				</base:principal>
				<core:if test="${not empty pv.role}"><span>[${pv.role}]</span></core:if>
				<span>${pv.date}</span>
				<span>${pv.week}</span>
				<a class="action-logout" data-href="<base:url href='auth/logout/'/>">退出系统</a>
			</div>
		</div>
	</div>

	<nav class="navbar">
		<a href="#" class="sidebar-toggle do-toggle-class" data-options="target:'body', className:'sidebar-o-open'"> <i class="fa fa-bars"></i> </a>

		<ul class="nav nav-pills">

			<core:forEach var="module" items="${sessionScope.LoginUserResources.children}">
			<li class="${module.options.color}<core:if test="${module.url == pv.module}"> active</core:if>">
				<a
					<core:choose>
					<core:when test="${module.options.absolute}">target="_blank" href="${module.url}"</core:when>
					<core:otherwise>
						<core:if test="${module.url != pv.module}">href="<base:url/><core:if test="${pv.tabs}">${module.url}</core:if><core:if test="${not pv.tabs}">${module.options.sublink}</core:if>"</core:if>
					</core:otherwise>
					</core:choose>
				>
					<core:if test="${not empty module.options.icon}">
						<i class="${module.options.icon}"></i>
					</core:if>
					${module.name}
				</a>
			</li>
			</core:forEach>

			<%--
			<li class="dropdown messages-menu">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
					<i class="fa fa-envelope-o"></i>
					<sup class="label label-success">4</sup>
				</a>
				<ul class="dropdown-menu">
					<li class="header">You have 4 messages</li>
					<li>
						<ul class="menu-content">
							<li>
								<a href="#">
									<div class="pull-left"> <img src="<base:url href='assets/img/user/default.png'/>" class="img-circle"> </div>
									<h4>Support Team <small><i class="fa fa-clock-o"></i> 5 mins</small> </h4>
									<p>Why not buy a new awesome theme?</p>
								</a>
							</li>
						</ul>
					</li>
					<li class="footer"><a href="#">See All Messages</a></li>
				</ul>
			</li>
			<li class="dropdown notifications-menu">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
					<i class="fa fa-bell-o"></i>
					<sup class="label label-warning">10</sup>
				</a>
				<ul class="dropdown-menu">
					<li class="header">You have 10 notifications</li>
					<li>
						<ul class="menu-content">
							<li>
								<a href="#"> <i class="fa fa-users text-aqua"></i> 5 new members joined today </a>
							</li>
						</ul>
					</li>
					<li class="footer"><a href="#">View all</a></li>
				</ul>
			</li>
			<li class="dropdown tasks-menu">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
					<i class="fa fa-flag-o"></i>
					<sup class="label label-danger">9</sup>
				</a>
				<ul class="dropdown-menu">
					<li class="header">You have 9 tasks</li>
					<li>
						<ul class="menu-content">
							<li>
								<a href="#">
									<h3> Design some buttons <small class="pull-right">20%</small> </h3>
									<div class="progress xs">
										<div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
											<span class="sr-only">20% Complete</span>
										</div>
									</div>
								</a>
							</li>
						</ul>
					</li>
					<li class="footer">
						<a href="#">View all tasks</a>
					</li>
				</ul>
			</li>
			--%>
			<%-- User Account: style can be found in dropdown.less --%>
			<li class="dropdown user user-menu show-in-simple">
				<base:principal var="user">
				<a href="#" class="dropdown-toggle user-info" data-toggle="dropdown" data-user-info="{tenantCode:'${user.tenantCode}',id:'${user.id}',displayName:'${user.displayName}'}">
					<core:if test="${empty user.portrait}"><img src="<base:url href='assets/img/user/default.png'/>" class="user-image img-circle"></core:if>
					<core:if test="${not empty user.portrait}"><img src="${user.portrait}" class="user-image img-circle"></core:if>
					<span>${user.displayName}</span>
				</a>
				<ul class="dropdown-menu">
					<li class="mt-xs">
						<p class="text-center">
							<core:if test="${empty user.portrait}"><img src="<base:url href='assets/img/user/default.png'/>" class="profile-user-img img-circle img-thumbnail"></core:if>
							<core:if test="${not empty user.portrait}"><img src="${user.portrait}" class="profile-user-img img-circle img-thumbnail"></core:if>
						</p>
						<h3 class="profile-username text-center mt-xs">${user.displayName}</h3>
						<p class="text-muted text-center">${user.phone}</p>
					</li>
					<li class="user-footer">
						<div class="pull-left">
							<a href="#" class="btn btn-default modify-mine-password">修改密码</a>
						</div>
						<div class="pull-right">
							<a href="#" class="btn btn-default open-mine-details">个人信息</a>
						</div>
					</li>
				</ul>
				</base:principal>
			</li>
			<li class="module-7 show-in-simple">
				<a class="action-logout" data-href="<base:url href='auth/logout/'/>" title="退出登录">
					<i class="fa fa-sign-out"></i>
					<span class="hide-in-simple">退出登录</span>
				</a>
			</li>
		</ul>
	</nav>



</header>

